const WebSocket = require('ws');

const wss = new WebSocket.Server({
    port:3000
});

wss.on('connection',(ws)=>{
   console.log('连接server成功~~~~~');

   ws.on('message',data =>{
        ws.send(data+' 举头望明月，低头挤暗疮')   
   });

   wss.on('close',()=>{
    console.log('连接关闭');
   });
 
});

